Improve your custom ranking by reducing granularity, so that similar records are ranked equally.
pageviews
first, followed by comments
. Here’s what the dataset would look like:
pageviews
has more weight than comments
. When we search for “algolia”, the “Algolia + SeaUrchin.IO” article comes before “Algolia Vault” only because it has one more unique pageview. However, this additional view is not meaningful. It doesn’t make the article more relevant. Nonetheless, the engine ignores the next custom ranking attribute because of it.
For these two records, it would be better if the article with the most comments appeared first: namely, that “Algolia Vault” article should come first because it has significantly more comments.
But changing the order of the attributes in the customRanking
parameter isn’t a good solution:
rounded_pageviews
attribute where we reduce the precision of pageviews
, and use it for custom ranking instead. In our case, one way of doing it could be to round page views to the nearest hundred.
rounded_pageviews
attribute for custom ranking instead of pageviews
. Now, searching for “algolia” would return the “Algolia Vault” article first, based on the comments
attribute.
pageviews
from the dataset; you might want to keep it for display purposes.
To know more on how to rank per custom attributes, check our guide.